import {addLocaleData} from 'react-intl';

import {localeData} from 'scratch-l10n';
import editorMessages from 'scratch-l10n/locales/editor-msgs';

addLocaleData(localeData);
const initialState = {
    locale: 'zh-cn',//默认为中文
    messages: editorMessages['zh-cn']
    //messagesByLocale: editorMessages,
};

const reducer = function (state, action) {
    if (typeof state === 'undefined') state = initialState;
    return state;
};

export {
    reducer as default,
    initialState as localesInitialState,
};
